package com.haifeng.wdsh.common.base.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * 自定义业务异常类
 */
@Data
@ToString
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public class BusinessException extends RuntimeException {

    private static final long serialVersionUID = 1L;
    private Integer errCode;

    public BusinessException(Integer errCode) {
        this.errCode = errCode;
    }

    public BusinessException(Integer errCode, String message) {
        super(message);
        this.errCode = errCode;
    }

    public BusinessException(Integer errCode, String message, Throwable cause) {
        super(message, cause);
        this.errCode = errCode;
    }

    public BusinessException(Integer errCode, Throwable cause) {
        super(cause);
        this.errCode = errCode;
    }

    public BusinessException(Integer errCode, String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.errCode = errCode;
    }
}
